/*
 * Powered By [zhangsd]
 * Email:springzjut@163.com
 * Since 2012 - 2012
 */

package com.feifan.senate.dal.student.impl;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.feifan.senate.common.DAOException;
import com.feifan.senate.dal.dataobject.student.StuRewardInfo;
import com.feifan.senate.dal.student.StuRewardInfoDAO;

@Repository
public class StuRewardInfoDAOImpl extends SqlMapClientDaoSupport implements StuRewardInfoDAO{
	
	private final static String NAME_SPACE = "StuRewardInfo";
	
	/**
	 * 新增
	 * @param entity
	 * @throws DAOException
	 */
	public void insert(StuRewardInfo entity) throws DAOException{
		this.getSqlMapClientTemplate().insert(NAME_SPACE + ".insert", entity);
	}
	
	/**
	 * 修改
	 * @param entity
	 * @throws DAOException
	 */
	public void update(StuRewardInfo entity) throws DAOException{
		this.getSqlMapClientTemplate().update(NAME_SPACE + ".update", entity);
	}
	
	/**
	 * 删除
	 * @param entity
	 * @throws DAOException
	 */
	public void delete(StuRewardInfo entity) throws DAOException{
		this.getSqlMapClientTemplate().update(NAME_SPACE + ".delete", entity);
	}
	
	/**
	 * 获取记录数
	 * @return
	 */
	public Integer count(StuRewardInfo entity){
		return (Integer) this.getSqlMapClientTemplate().queryForObject(NAME_SPACE + ".count", entity);
	}
	
	/**
	 * 查询记录
	 * @param entity
	 * @throws DAOException
	 */
	@SuppressWarnings("unchecked")
	public List<StuRewardInfo> queryList(StuRewardInfo entity) throws DAOException{
		return (List<StuRewardInfo>) this.getSqlMapClientTemplate()
		.queryForList(NAME_SPACE + ".queryList", entity);
	}
	
	
}